package EveryDay;

import java.util.PriorityQueue;
import java.util.Queue;

public class P1845 {
}

class SeatManager {
        /**
         * 优先队列
         * */
        private Queue<Integer> queue;

        //构造位置
        public SeatManager(int n) {
            queue=new PriorityQueue<>();
            for(int i=1;i<=n;i++){
                queue.offer(i);
            }

        }
        //预约
        public int reserve() {
            return queue.poll();
        }
        //取消预约
        public void unreserve(int seatNumber) {
            queue.offer(seatNumber);
        }
    }
